﻿using System;
using System.Collections.Generic;
using System.Data.Objects.DataClasses;
#if DEBUG
using System.Diagnostics;
#endif // #if DEBUG
using System.Linq;
using System.Text;

using FRL.DebtChased.WebServices;

namespace FRL.DebtChased.Repository
{

	/// <summary>
	/// Extensions to the FinanceTeam model
	/// </summary>
	public partial class FinanceTeam
	{

		/////////////////////////////////////////////////////////////
		// Static Operations

		public static Dictionary<int, string> GetDictionary(DebtChasedEntities ent)
		{

			// Load the finance-teams
			var financeTeams = from ft in ent.FinanceTeams
								orderby ft.Name
								select new { ft.FinanceTeamId, ft.Name };

			// Create dictionary
			return financeTeams.ToDictionary(ft => ft.FinanceTeamId, ft => ft.Name);

		}

	}

}
